﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="PR_SalaryPromotionConfig.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PR_SalaryPromotionConfig" %>

<%@ Register src="../Controls/EmployeeTypeCombo.ascx" tagname="EmployeeTypeCombo" tagprefix="uc1" %>
<%@ Register src="../Controls/JobSiteCombo.ascx" tagname="JobSiteCombo" tagprefix="uc2" %>
<%@ Register src="../Controls/MasterYear.ascx" tagname="MasterYear" tagprefix="uc3" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc4" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  

 <script type="text/javascript" src="../../Scripts/DatePicker.js">
 
  </script>
<script type="text/javascript">   

          function isNumberKey(event)  // ตัวเลขอย่างเดียว
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57)){
//                 alert("กรอกได้แต่ตัวเลขครับ!")
                 return false;
	          }
             return true;
          }
           function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }

                function openProjectDetails(id) {
                    radopen("PR_SalaryPromotionBaseConfig.aspx?prm_seq=" + id, "ProjectDtls");
                    return false;

                    //maximunWindow();
                }
         
</script>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
    <telerik:RadWindow 
        id="ProjectDtls" 
        runat="server"
        showcontentduringload="false"
        title=""
        width="900px"
        Height="490px"        
        Modal="true"
        behaviors="Close">
    </telerik:RadWindow>
</Windows>

        <Windows>
            <telerik:RadWindow 
                ID="RadWindow1"  
                DestroyOnClose = "true"               
                Modal ="true"                
                VisibleStatusbar ="false"
                runat="server">
            </telerik:RadWindow>
        </Windows>


</telerik:RadWindowManager>
    
    <title>ผลการประเมินการปฏิบัติราชการ</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" /> 
    
      <asp:panel ID="Panel6" runat="server" >
    <table width="1000" cellpadding="0" cellspacing="0">
        <tr>
            <td width="280" valign = "top">
               <!-- <uc4:user ID="user1" runat="server" /> -->
            </td>
            
              <td width="20" >
            
            <td>
            
            <div class="moduleDivSlim700">
                    <div class="moduleDivBottom700">
                         <asp:Panel ID="PanelFilter" runat="server" Width="700px" ScrollBars="Auto">
                            <table align = "center" width = "650px">
                                    <tr>
                                        <td align="right" >
                                                  ประเภทบุคลากร :</td>
                                              <td >
                                         
                                                  <telerik:RadComboBox ID="cbEmployeeType" runat="server" AutoPostBack="True" 
                                                      CausesValidation="false" DataTextField="Name" DataValueField="Sequence" 
                                                      EmptyMessage="...เลือกประเภทบุคลากร..." Filter="Contains" 
                                                      OnClientTextChange="onTextChange" 
                                                      onselectedindexchanged="cbEmployeeType_SelectedIndexChanged" Width="200px">
                                                  </telerik:RadComboBox>                                         
                                              </td>
                                              <td >
                                                  <asp:Label ID="lblTypeYear" runat="server" Text="lblTypeYear"></asp:Label>
                                              </td>
                                              <td >                                                
                                                  <telerik:RadComboBox ID="cbYear" runat="server" AllowCustomText="true" 
                                                      AutoPostBack="True" CausesValidation="false" DataTextField="Name" 
                                                      DataValueField="Name" EmptyMessage="...เลือกปี ..." Filter="Contains" 
                                                      OnClientTextChange="onTextChange"  
                                                      onselectedindexchanged="cbYear_SelectedIndexChanged" Width="100px">
                                                  </telerik:RadComboBox>
                                              </td>
                                               <td >
                                                  <asp:Button ID="cmdSearch" runat="server" onclick="cmdSearch_Click" 
                                                      Text="ค้นหา" Width="104px" Visible = "false" />
                                              </td>
                                    </tr>
                                </table>
                        </asp:Panel>
                    </div>
                </div>            
            
            </td>
            
          </tr>
          </table>          
          
          <tr>
          <td colspan = "3">
        <div class="moduleDivSlim1000x450">
        <div class="moduleDivBottom1000">
        <table align="center" width ="980px" >
        <tr>
            <td align="left" class="tableHeader">
             กำหนดข้อมูลตั้งต้นการเลื่อนเงินเดือน</td>
        </tr>
        </table>
        <table width ="980px" align="center"  >
        <tr>
        <td >
        <asp:Panel ID="PanelGrid" 
            runat="server" 
            Width="970px" 
            Height="410px" ScrollBars="Auto" >
                <telerik:RadGrid ID="RadGrid2" runat="server" 
                    AllowFilteringByColumn="True" 
                    AllowAutomaticDeletes="True"
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" 
                    AllowPaging="True" 
                    AllowSorting="True" 
                    AutoGenerateColumns="False"                     
                    EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" 
                    GridLines="None" 
                    OnItemCommand="RadGrid2_ItemCommand" 
                    Skin="Outlook" 
                    Width="960px" 
                    onitemdatabound="RadGrid2_ItemDataBound" 
                    onneeddatasource="RadGrid2_NeedDataSource" CellSpacing="0" 
                    ongroupschanging="RadGrid2_GroupsChanging">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        PagerStyle-AlwaysVisible = "true"
                        CellSpacing="-1" 
                        ClientDataKeyNames="prm_seq"
                        CommandItemDisplay="Top"
                        DataKeyNames="prm_seq" 
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                            CommandName="InitInsert" 
                                            Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>"> <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                            style="border: 0px; vertical-align: middle;" />เพิ่มข้อมูลตั้งต้นการเลื่อนเงินเดือน</asp:LinkButton>
                                        &nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
  
                        <ExpandCollapseColumn Visible="True">
                        </ExpandCollapseColumn>
                           
                        <Columns>
                            <telerik:GridEditCommandColumn 
                                EditText = "คลิกเพื่อแก้ไขรายการ"
                                ButtonType="ImageButton">
                                <HeaderStyle HorizontalAlign="Center" Width="15px" />
                                <ItemStyle HorizontalAlign="Center" Width="15px" />                                      
                            </telerik:GridEditCommandColumn>
                            
                            <telerik:GridButtonColumn ButtonType="ImageButton" 
                                CommandName="Delete" 
                                ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?" 
                                Text="คลิกเพื่อลบข้อมูล" 
                                UniqueName="column1">
                                <HeaderStyle HorizontalAlign="Center" Width="10px" />
                                <ItemStyle HorizontalAlign="Center" Width="10px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridTemplateColumn
                                DataField="prm_year"
                                HeaderText="ปีงบประมาณ" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                CurrentFilterFunction="Contains"
                                AutoPostBackOnFilter="true"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                UniqueName="prm_year">
                                <ItemTemplate>
                                    <%# Eval("prm_year")%>                        
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn>
                         
                             <telerik:GridTemplateColumn
                                DataField="prm_period" 
                                HeaderText="ครั้งที่" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                CurrentFilterFunction="Contains"
                                AutoPostBackOnFilter="true"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                UniqueName="prm_period" >                                
                               <ItemTemplate>
                                <%# Eval("prm_period")%>                        
                               </ItemTemplate>                                  
                                 <HeaderStyle HorizontalAlign="Center" />
                                 <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn>
                            
                            <telerik:GridTemplateColumn
                                DataField="prm_name"
                                HeaderText="ชื่อการเลื่อนเงินเดือน" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                CurrentFilterFunction="Contains"
                                AutoPostBackOnFilter="true"
                                HeaderStyle-HorizontalAlign = "Center"
                                UniqueName="prm_name">
                                <ItemTemplate>
                                     <asp:LinkButton ID="targetControl" runat="server" Text='<%# Eval("prm_name")%>' OnClientClick='<%# Eval("prm_seq","Javascript:return openProjectDetails({0})") %>'></asp:LinkButton>                        
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                           </telerik:GridTemplateColumn>
                                                      
                           <telerik:GridTemplateColumn                            
                                DataField="prm_quota" 
                                HeaderText="คิดโควต้า (%)" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                CurrentFilterFunction="Contains"
                                AutoPostBackOnFilter="true"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                UniqueName="prm_quota">
                                <ItemTemplate>
                                    <%# Eval("prm_quota")%>                        
                                </ItemTemplate>                                       
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" />
                           </telerik:GridTemplateColumn>
                                     
                           <telerik:GridBoundColumn   
                                DataField="prm_date" 
                                HeaderText="ของบุคลากร ณ วันที่" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                CurrentFilterFunction="Contains"
                                AutoPostBackOnFilter="true"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                UniqueName="prm_date"                                
                                DataFormatString ="{0:dd/MM/yyyy}">                                 
                               <HeaderStyle HorizontalAlign="Center" />
                               <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="prm_seq" 
                                FilterControlAltText="Filter prm_seq column" UniqueName="prm_seq" 
                                Visible="False">
                            </telerik:GridBoundColumn>
                        </Columns>
                        
                        <EditFormSettings EditFormType="WebUserControl" 
                            UserControlName="../UserControls/PR_SalaryPromotionConfig.ascx">
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                        <PagerStyle AlwaysVisible="true" 
                            FirstPageToolTip="กลับหน้าแรก" 
                            LastPageToolTip="ไปหน้าสุดท้าย" 
                            Mode="NextPrevNumericAndAdvanced" 
                            NextPagesToolTip="หน้าถัดไป" 
                            NextPageToolTip="หน้าถัดไป" 
                            PrevPagesToolTip="ย้อนกลับ" 
                            PrevPageToolTip="ย้อนกลับ" />
                    </MasterTableView>
                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>
            </asp:Panel>
                </td>
                </tr>
                </table>
                </div>
</div>
</td>
</tr>
</table>
</asp:panel>

</asp:Content>
